package com.neusoft.staticagent;

/**
 * @Author: duan
 * @Date: Create in 11:20 2020/10/29
 */
public class Agent implements Rent {
    private Rent rent;

    public void setRent(Rent rent) {
        this.rent = rent;
    }

    public void rent() {
        System.out.println("中介出租");

        boolean look = look();
        if (look) {
            lookLandlord();
            charge();
        }
    }

    public boolean look() {
        System.out.println("看房子");
        return true;
    }

    public void lookLandlord() {
        System.out.println("见房东");
        rent.rent();
        System.out.println("签合同");
    }

    public void charge() {
        System.out.println("收费");
    }
}
